var validator={
    mainFun:function(){
        var t=this;
        $("form").validator({
		rules: {
            mobel: [/(^[1][0-9]{10}$)/, "手机号格式错误"],
		},
        fields: {
            roleType: {
                rule: "required;"
            },
            tel: {
                rule: "required;mobel"
            },
            captcha: {
                rule: "required;"
            },
            password: {
                rule: "required;length(6~32)"
            }
        },
        valid: function (form) {
            var me = this;
            me.holdSubmit();
            var entity = {
                roleType: $("input[name='roleType']").val(),
                tel: $("input[name='tel']").val(),
                password:$("input[name='password']").val(),
                captcha: $("input[name='captcha']").val(),
            };
            var data = { Entity: JSON.stringify(entity) };
            $('#loading').show();
            $.ajax({
                url: t.submitUrl,
                data: data,
                type: 'POST',
                success: function (data) {
                    t.fun2(data);
					      me.holdSubmit(false);
                }
            });
        }
    });
    },
    submitUrl:'/NextBOrganizer/register8/',
};
